﻿#include "Enemy2.h"
#include "GameUtil.h"

using namespace cocos2d;

Enemy2::Enemy2(void)
{
}


Enemy2::~Enemy2(void)
{
}

bool Enemy2::init(){  
    if (!Enemy::init()) {  
        return false;  
    }  

	// init
	d_creatureSprite->initWithFile("e2.png");

	d_maxHP = 150;
	d_speed = 70;
	d_shootInterval = 400;
	d_stopPos = 65;
	d_bulletSpeed = 100;
	d_bulletDamage = 5;
	d_bulletType = BULLET_TYPE_4;

    return true;  
}

CCAction* Enemy2::getWalkAction(){
    CCActionInterval*  actionBy = CCScaleBy::create(1.0f, 0.9f, 1.1f);
	CCAction* act = CCRepeatForever::create(CCSequence::create(actionBy, actionBy->reverse(), NULL));
	return act;
}

void Enemy2::shoot(float dt)
{
	d_bulletManager->shoot(this, 0);
	d_bulletManager->shoot(this, 10);
	d_bulletManager->shoot(this, -10);
}
